<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<!--<html>-->
	<head>
		<th:block th:include="common/head::head"/>
		<title>购物车</title>
		<link rel="stylesheet" type="text/css" th:href="@{/css/style.min.css}" />
	</head>
	<body th:inline="text">
		<div class="w">
			<div th:replace="common/top::top"></div>
			<div class="h">
				<div id="main">
					<br>
					<h1 style="color: red">为了测试分页效果，故意设置分页格式为：” 2条/页 （数据）“ </h1>
					<br><br><br>

					<div class="book_cond">
						<form th:action="@{/cart/CartSelect.do}" method="get">
<!--							<input type="hidden" name="action" value="pageByPrice">-->
							价格：
							<input id="min" type="text" name="min" th:placeholder="${min}"> 元 -
							<input id="max" type="text" name="max" th:placeholder="${max}"> 元
							<input type="radio" name="order" th:value="1" th:checked="${order}" />升序(默认)
							<input type="radio" name="order" th:value="0" />降序
							<input type="submit" value="查询" />

						</form>
					</div>

					<table>
						<tr>
							<td>商品名称</td>
							<td>地址</td>
							<td>数量</td>
							<td>单价</td>
							<td>金额</td>
							<td>操作</td>
						</tr>
						<th:block  th:unless="${cart_Total}">
							<tr>
								<td colspan="5">
									<br><br><br>
									<a th:href="@{index}">
										  购物车空空，目前还没有即将属于“[[${session.user.uname}]]”的完美旅行哦~
									</a>
								</td>
							</tr>
						</th:block>
<!--						<c:if test="${empty sessionScope.count or sessionScope.count==0}">-->
<!--							<%&#45;&#45;如果购物车空的情况&#45;&#45;%>-->
<!--							<tr>-->
<!--								<td colspan="5"><a href="index.html">购物车空空，目前还没有即将属于${sessionScope.name}的完美旅行哦~</a></td>-->
<!--							</tr>-->
<!--						</c:if>-->
						<th:block th:if ="${cart_Total}">
							<th:block th:each="cartVO:${cartVOS}">
								<tr>
									<td th:text="${cartVO.name}"></td>
									<td th:text="${cartVO.address}"></td>
									<td th:text="${cartVO.amount}"></td>
									<td th:text="${cartVO.unitPrice}"></td>
									<td th:text="${cartVO.price}"></td>
									<td><a class="deleteItem"
										   th:href="@{/cart/DeleteItem.do(cartId=${cartVO.getId()})}"
											methods="get">删除</a>
									</td>
								</tr>
							</th:block>
						</th:block>
					</table>
					<!-- <%--如果购物车非空才输出页面的内容--%> -->
					<th:block th:if="${cart_Total}">
						<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

							共<a style="color: red; font-size: x-large" href="javascript:;">&nbsp;[[${cart_Pages}]]&nbsp;</a>页
							<span class="cart_span">共有<span class="b_count" th:text="${cart_Total}"></span>条记录</span>,
<!--							<span class="cart_span">共有<span class="b_count" th:text="${recordsAmount}">件商品</span></span>-->

							<br>




							第
							<th:block th:if="${cart_Current}> 1">
								<span>&nbsp;&nbsp;&nbsp;</span><span>&nbsp;&nbsp;&nbsp;</span>
								<a style="color: #0077aa" th:href="@{/cart/CartSelect.do(max=${max},min=${min},max=${max},order=${order},currentPageSize=${cart_Current}-1)}">[[${cart_Current-1}]]</a>
								<span>&nbsp;&nbsp;&nbsp;</span>
							</th:block>
							&nbsp;&nbsp;&nbsp;<a style="color: red; font-size: x-large" href="javascript:;">[[${cart_Current}]]</a>&nbsp;&nbsp;&nbsp;
							<th:block th:if="${cart_Pages } > ${cart_Current}">
								<span>&nbsp;&nbsp;&nbsp;</span>
								<a style="color: #0077aa"  th:href="@{/cart/CartSelect.do(max=${max},min=${min},max=${max},order=${order},currentPageSize=${cart_Current}+1)}" >[[${cart_Current+1}]]</a>
								<span>&nbsp;&nbsp;&nbsp;</span><span>&nbsp;&nbsp;&nbsp;</span>
							</th:block>
							页

							<div th:if="${cart_Current}> 1" >
								<span>&nbsp;&nbsp;&nbsp;</span><span>&nbsp;&nbsp;&nbsp;</span>
								<button type="button"><a th:href="@{/cart/CartSelect.do(max=${max},min=${min},max=${max},order=${order},currentPageSize=${cart_Current}-1)}">上一页</a></button>
							</div>


							<div th:if="${cart_Pages} > ${cart_Current}">
								<span>&nbsp;&nbsp;&nbsp;</span>
								<button type="button"><a th:href="@{/cart/CartSelect.do(max=${max},min=${min},max=${max},order=${order},currentPageSize=${cart_Current}+1)}">下一页</a></button>
							</div>
						</div>

						<div class="cart_info">

							<span class="cart_span"><a id="clearCart" th:href="@{'/cart/DeleteAll.do?uid='+${session.user.uid}}">清空购物车</a>
<!--								共<h1  style="color: orangered"  >[[${recordsTotalPrice}]]</h1>-->
								<a href="#">去结账</a>
							</span>
						</div>
					</th:block>
				</div>
			</div>
			<th:block th:replace="common/end::end"/>

		</div>
	</body>
</html>
